package cn.yunhe.dplayerdemo3.Service.impl;

import cn.yunhe.dplayerdemo3.Service.IUserInfoService;
import cn.yunhe.dplayerdemo3.entity.UserInfo;
import cn.yunhe.dplayerdemo3.mapper.IUserInfoMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserInfoService extends ServiceImpl<IUserInfoMapper, UserInfo> implements IUserInfoService {

    @Autowired
    private IUserInfoMapper userInfoMapper;


    @Override
    public UserInfo getUserInfoByName(UserInfo userInfo) {
        return userInfoMapper.getUserInfoByName(userInfo);
    }

    @Override
    public boolean updateUserInfo(int coinNum, int uid) {
        if (userInfoMapper.updateUserInfo(coinNum, uid) > 0) {
            return true;
        } else {
            return false;
        }
    }
}
